<?php

/**
 * Description of sfWidgetFormSchemaFormatterDiv
 *
 * @author Tazenda
 */
class sfWidgetFormSchemaFormatterDiv extends sfWidgetFormSchemaFormatter
{
    protected 
        $rowFormat       = '<div class="form_row span-17 last">
                                <div class="form_row_field span-10">
                                    <div class="form_row_field_label span-4">%label%</div>
                                    <div class="form_row_field_input span-6 last">%field%</div>
                                </div>
                                %error%
                                %help%
                                %hidden_fields%
                            </div>',
        $errorRowFormat  = '',
        $helpFormat      = '<div class="form_help">%help%</div>',
        $errorListFormatInARow = '<div class="form_row_error span-6 last">%errors%</div>',
        $errorRowFormatInARow      = "<p>%error%</p>",
        $decoratorFormat = '<div class="form">%content%</div>';
    
    public function formatRow($label, $field, $errors = array(), $help = '', $hiddenFields = null)
    {
        $row = parent::formatRow(
            $label,
            $field,
            $errors,
            $help,
            $hiddenFields
        );

        return strtr($row, array('%row_class%' => (count($errors) > 0) ? ' form_row_error' : '',));
    }
}
